package com.sc.nft.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.sc.nft.entity.dto.TeamIncomeDTO;
import com.sc.nft.entity.dto.TeamUserPerformanceDTO;
import lombok.extern.slf4j.Slf4j;
import com.sc.nft.entity.UserDaoPerformance;
import com.sc.nft.mapper.UserDaoPerformanceMapper;
import  com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 用户DAO业绩(sc_user_dao_performance)数据DAO
 *
 * @author zxy
 * @since 2023-12-12 17:26:18
 * @description 商户banner
 */
@Slf4j
@Repository
public class UserDaoPerformanceDao extends ServiceImpl<UserDaoPerformanceMapper, UserDaoPerformance> {

    public UserDaoPerformance getByDaoIdAndUserId(Long daoId,Long userId,String recordDate){
        return lambdaQuery().eq(UserDaoPerformance::getUserId,userId).eq(UserDaoPerformance::getDaoId,daoId).eq(UserDaoPerformance::getRecordDate,recordDate).one();
    }

    public List<TeamUserPerformanceDTO> getDaoSumPerformance(Long daoId, List<Long> userIds, String startDate){
        return baseMapper.getDaoSumPerformance(daoId, userIds, startDate);
    }

    public List<TeamUserPerformanceDTO> getDaoSumCenterPerformance(Long daoId, List<Long> userIds, String startDate){
        return baseMapper.getDaoSumCenterPerformance(daoId, userIds, startDate);
    }

}